Azure Maps Route Service (preview:2024-07-01)

2025/10/23 • 2 updated methods

Route_PostSnapToRoads (updated)
Description This process, known as "snapping to roads", produces a series of objects that trace a path closely following the road network. The resulting data includes road names and their respective speed limits, pertinent to the traversed segments. Moreover, the Snap to Roads API offers an interpolation feature, which refines the GPS points to create a smoother route that adheres to the road's geometry. This functionality is especially beneficial for asset tracking and enhancing data visualization in mapping applications. >[!Important] > The GPS points must be within 6 kilometer of each other. For information about routing availability in countries/regions, see [Azure Maps routing coverage](https://learn.microsoft.com/azure/azure-maps/routing-coverage?pivots=route-v2). >[!Important] >By using this feature, you agree to the preview legal terms. See the [Preview Supplemental Terms](https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/) for additional details.
Reference Link ¶

⚶ Changes

{
  "#id": "Route_PostSnapToRoads",
  "$parameters": {
    "snapToRoadsRequest": {
      "$properties": [
        {
          "#name": "features",
          "Description": {
            "new": "A set of points to snap to road network. You can have a minimum of 2 points and maximum of 5000 points and the two consecutive points must be within 6 kilometer of each other and a total road distance of up to 100 kilometers. Refer to [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946) for details on the GeoJSON format.\n\n`Note`: The API will not return a point object in the response for the GPS point that cannot be snapped to a road network.",
            "old": "A set of points to snap to road network. You can have a minimum of 2 points and maximum of 100 points and the two consecutive points must be within 6 kilometer of each other and a total road distance of up to 100 kilometers. Refer to [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946) for details on the GeoJSON format.\n\n`Note`: The API will not return a point object in the response for the GPS point that cannot be snapped to a road network."
          }
        }
      ]
    }
  }
}

⚼ Request

POST:  /route/snapToRoads
{
api-version: string ,
x-ms-client-id: string ,
Accept-Language: string ,
snapToRoadsRequest:
{
type: enum ,
features:
[
{
type: enum ,
geometry: object ,
properties: object ,
}
,
]
,
interpolate: boolean ,
includeSpeedLimit: boolean ,
travelMode: enum ,
}
,
}

⚐ Response (200)

{
type: enum ,
features:
[
object ,
]
,
}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
Route_PostRouteRange (updated)
Description A polygon boundary (or Isochrone) is returned in a counterclockwise orientation as well as the precise polygon center which was the result of the origin point. The returned polygon can be used for spatial filtering to search for features of interest within the provided Isochrone. For information about routing availability in countries/regions, see [Azure Maps routing coverage](https://learn.microsoft.com/azure/azure-maps/routing-coverage?pivots=route-v2). >[!Important] >By using this feature, you agree to the preview legal terms. See the [Preview Supplemental Terms](https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/) for additional details.
Reference Link ¶

⚶ Changes

{
  "#id": "Route_PostRouteRange",
  "$parameters": {
    "routeRangeRequest": {
      "$properties": {
        "properties": [
          {
            "#name": "distanceBudgetInMeters ",
            "Description": {
              "new": "The distance budget specifies the maximum range in meters which can be traveled from the origin waypoint. It cannot be set when `timeBudgetInSec` is specified.\n\nWhen `isSimplifiedPolygon` is false, the maximum distance supported is 90000 meters; otherwise, it is 500,000 meters.\n\nExample: \"distanceBudgetInMeters\":5000",
              "old": "The distance budget specifies the maximum range in meters which can be traveled from the origin waypoint. It cannot be set when `timeBudgetInSec` is specified.\n\nWhen `isSimplifiedPolygon` is false, the maximum distance supported is 360,000 meters; otherwise, it is 500,000 meters.\n\nExample: \"distanceBudgetInMeters\":5000"
            }
          },
          {
            "#name": "timeBudgetInSec",
            "Description": {
              "new": "The time budget specifies the maximum time in seconds available for travel, defining how far one can go within this time constraint from the origin waypoint. It cannot be set when `distanceBudgetInMeters` is specified.\n\nWhen `isSimplifiedPolygon` is false, the maximum time supported is 3600 seconds; otherwise, it is 21,600 seconds.\n\nExample: \"timeBudgetInSec\":3600",
              "old": "The time budget specifies the maximum time in seconds available for travel, defining how far one can go within this time constraint from the origin waypoint. It cannot be set when `distanceBudgetInMeters` is specified.\n\nWhen `isSimplifiedPolygon` is false, the maximum time supported is 14,400 seconds; otherwise, it is 21,600 seconds.\n\nExample: \"timeBudgetInSec\":3600"
            }
          }
        ]
      }
    }
  }
}

⚼ Request

POST:  /route/range
{
api-version: string ,
x-ms-client-id: string ,
routeRangeRequest:
{
type: enum ,
geometry: object ,
properties:
{
departAt: string ,
isSimplifiedPolygon: boolean ,
optimizeRoute: enum ,
avoid:
[
string ,
]
,
vehicleSpec: object ,
distanceBudgetInMeters : number ,
timeBudgetInSec: number ,
travelMode: enum ,
}
,
}
,
}

⚐ Response (200)

{
type: enum ,
features:
[
object ,
]
,
}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}